package com.ruoyi.bookkeeping.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bookkeeping.mapper.BookUserMapper;
import com.ruoyi.bookkeeping.domain.BookUser;
import com.ruoyi.bookkeeping.service.IBookUserService;

/**
 * 用户Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-02-24
 */
@Service
public class BookUserServiceImpl extends ServiceImpl<BookUserMapper,BookUser> implements IBookUserService
{
    @Autowired
    private BookUserMapper bookUserMapper;

    /**
     * 查询用户
     * 
     * @param userId 用户主键
     * @return 用户
     */
    @Override
    public BookUser selectBookUserByUserId(Long userId)
    {
        return bookUserMapper.selectBookUserByUserId(userId);
    }

    /**
     * 查询用户列表
     * 
     * @param bookUser 用户
     * @return 用户
     */
    @Override
    public List<BookUser> selectBookUserList(BookUser bookUser)
    {
        return bookUserMapper.selectBookUserList(bookUser);
    }

    /**
     * 新增用户
     * 
     * @param bookUser 用户
     * @return 结果
     */
    @Override
    public int insertBookUser(BookUser bookUser)
    {
        return bookUserMapper.insertBookUser(bookUser);
    }

    /**
     * 修改用户
     * 
     * @param bookUser 用户
     * @return 结果
     */
    @Override
    public int updateBookUser(BookUser bookUser)
    {
        return bookUserMapper.updateBookUser(bookUser);
    }

    /**
     * 批量删除用户
     * 
     * @param userIds 需要删除的用户主键
     * @return 结果
     */
    @Override
    public int deleteBookUserByUserIds(Long[] userIds)
    {
        return bookUserMapper.deleteBookUserByUserIds(userIds);
    }

    /**
     * 删除用户信息
     * 
     * @param userId 用户主键
     * @return 结果
     */
    @Override
    public int deleteBookUserByUserId(Long userId)
    {
        return bookUserMapper.deleteBookUserByUserId(userId);
    }
}
